package org.linka.study.node;

public class MyLinkedList {
	
	int size=0;
	Node head=null;
	public void add(Object value) {
		Node temp=new Node(value);
		if(head==null){
			head=temp;
		}else{
			head.setNext(temp);
		}
		size++;
	}
	
	public Object getIndex(int index){
		Node tempNode=head;
		for(int i=0;i<index;i++){
			tempNode=tempNode.getNext();
		}
		return tempNode.getValue();
	}
}
